//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class Break : IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext ctx = context.Read("brk"))
            {
                id = ctx.GetOptionalInteger("id", 0);
                min = ctx.GetOptionalInteger("min", 0);
                max = ctx.GetOptionalInteger("max", 0);
                man = ctx.GetOptionalBoolean("man", false);
                pt = ctx.GetOptionalBoolean("pt", false);
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext ctx = context.Write("brk"))
            {
                ctx.SetOptionalInteger("id", id, 0);
                ctx.SetOptionalInteger("min", min, 0);
                ctx.SetOptionalInteger("max", max, 0);
                ctx.SetOptionalBoolean("man", man, false);
                ctx.SetOptionalBoolean("pt", pt, false);
            }
        }

        #endregion

        private int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        private int min;

        public int Minimum
        {
            get { return min; }
            set { min = value; }
        }
        private int max;

        public int Maximum
        {
            get { return max; }
            set { max = value; }
        }
        private bool man;

        public bool Manual
        {
            get { return man; }
            set { man = value; }
        }
        private bool pt;

        public bool PivotCreated
        {
            get { return pt; }
            set { pt = value; }
        }




    }
}
